package main

import (
	"encoding/xml"
	"fmt"
	"io/ioutil"
	"net/http"
	"os"
)

type MiStatus struct {
	XMLName xml.Name `xml:"property"`
	ReturnCode string    `xml:"returncode"`
	Key        string    `xml:"key"`
	Original   string    `xml:"original"`
}
type pro struct {
	ReturnCode int    `xml:"returncode"`
	Key        string    `xml:"key"`
	Original   string    `xml:"original"`
}

func main() {

	xmlStr := `<?xml version="1.0" encoding="utf-8"?>
<property>
<returncode>300</returncode>
<key>null</key>
<original>213 : Timeout</original>
</property>`

	var req  = MiStatus{}
	err := xml.Unmarshal([]byte(xmlStr),&req)
	if err != nil{
		panic(err)
	}
	fmt.Printf("%#v",req)
	os.Exit(1)

}

func proxyCurl() {

	os.Setenv("HTTP_PROXY", "115.239.24.207:9999")
	req, err := http.Get("http://test-m.66rpg.com/test/ts")
	defer req.Body.Close()
	if err != nil {
		panic(err)
	}
	content, err := ioutil.ReadAll(req.Body)
	if err != nil {
		panic(err)
	}
	fmt.Println(string(content))
}
